<form id="categoryForm">
    <input name="id" type="hidden" th:value="${category?.id}">
    <input id="d-pid" name="pid" type="hidden" th:value="${category?.pid == null ? 0 : category?.pid}">
    <div class="form-group row">
        <label for="d-pname" class="col-sm-2 col-form-label">上级分类:</label>
        <div class="col-sm-10">
            <input type="text" onclick="showCategory(2)" th:value="${category?.parent==null?'无':category?.parent?.name}"
                   class="form-control" id="d-pname" placeholder="选择上级分类" readonly>
        </div>
    </div>
    <div class="form-group row">
        <label for="name" class="col-sm-2 col-form-label">分类名称</label>
        <div class="col-sm-10">
            <input type="text" th:value="${category?.name}" name="name" class="form-control" id="name"
                   placeholder="填写分类名称" required>
        </div>
        <div class="invalid-feedback">请填写分类名称</div>
    </div>
    <div class="form-group row">
        <label for="description" class="col-sm-2 col-form-label">分类描述</label>
        <div class="col-sm-10">
            <input type="text" th:value="${category?.description}" name="description" class="form-control"
                   id="description"
                   placeholder="填写分类描述" required>
            <div class="invalid-feedback">请填写分类描述</div>
        </div>
    </div>
    <div class="form-group row">
        <label for="sort" class="col-sm-2 col-form-label">分类排序</label>
        <div class="col-sm-10">
            <input type="text" th:value="${category?.sort}" name="sort" class="form-control" id="sort"
                   placeholder="填写分类描述" required>
            <div class="invalid-feedback">请填写分类排序</div>
        </div>
    </div>
</form>